$(document).ready(function() {
    var speed = 6000;
    // 循环变量1 避免定时器等第一张图片
    var m = 1;
    var playTimer = setInterval(runPlay, speed);

    function runPlay() {
        if (m > 3) {
            m = 0;
        }
        controlPlay(m);
        m++;
    }

    function controlPlay(n) {
        $('#lunbo a').removeClass('current').eq(n).addClass('current');
    }

    $('#content').on({
        mouseenter: function () {
            clearInterval(playTimer);
        },
        mouseleave: function () {
            playTimer = setInterval(runPlay, speed);
        }
    });

    $('.slider_arrow').on({
        click: function () {
            if(m>3){
                m=0;
            }
            // 显示下一张图
            controlPlay(m);
            m ++;
        }
    });
});

